(define cyl-system-symbol-dict-list
  '(("如果" 系统宏 (sys 101) 2 inf (has-key ("那么" "否则")))
    ("否则" 系统关键字 (sys 102)  1 inf "如果" (loc-num (3 inf)) (begin ) ("那么"))
    ("那么" 系统关键字 (sys 114)  2 inf "如果" (loc-num (2 2)) (begin ))
    ("分类" 系统宏 (sys 103) 1 inf (has-key ("若" "否则")))
    ("注册" 系统宏 (sys 104) 2 inf (has-key ("数据结构" "cyl文件" "软件包" "别名" "外部符号" "关键字" "自定义宏" "scm文件")))
    ("cyl文件" 系统关键字 (sys 124) 1 inf "注册" (loc-num (1 1)) strip )
    ("scm文件" 系统关键字 (sys 125) 1 inf "注册" (loc-num (1 1)) strip )
    ("别名" 系统关键字 (sys 123) 2 inf "注册" (loc-num (1 1)) strip)
    ("循环" 系统宏 (sys 105) 1 inf)
    ("遍历" 系统宏 (sys 106) 4 inf (has-key ("针对每个索引" "针对每个元素" "针对每个子项" "针对每组索引子项"))(has-var 3 "执行"))
    ("否则" 系统关键字 (sys 115) 1 inf "分类" (loc-num (1 inf)) (else ) ("若"))
    ("若"  系统关键字 (sys 113) 2 inf "分类" (loc-num (1 inf)) (list ) ("若"))
    ("针对每个索引" 系统关键字 (sys 116) 2 inf "遍历" (loc-num (2 2)) (list))
    ("针对每个元素" 系统关键字 (sys 117) 2 inf "遍历" (loc-num (2 2)) (list))
    ("针对每个子项" 系统关键字 (sys 118) 2 inf "遍历" (loc-num (2 2)) (list))
    ("针对每组索引子项" 系统关键字 (sys 121) 2 inf "遍历" (loc-num (2 2)) (list))
    ("执行" 系统关键字 (sys 122) 2 inf "遍历" (loc-num (2 2)) () ("针对每个索引" "针对每个元素" "针对每个子项" "针对每组索引子项"))
    ("循环退出" 系统无参函数 (sys 119) 0 0)
    ("宏终结语句" 系统无参函数 (sys 120) 0 0)
    ("函数返回" 系统无参函数 (sys 130) 0 0)
    ("在[*]中" 系统状语宏 (sys 140) 1 inf)
    ("真" 系统常量 (sys 150) 0 0)
    ("假" 系统常量 (sys 151) 0 0)
    ("空" 系统常量 (sys 152) 0 0)
    ("错误" 系统常量 (sys 153) 0 0)
    
    ("[*]+[*]" 系统函数 (sys 207) 2 2)
    ("[*]-[*]" 系统函数 (sys 208) 2 2)
    ("[*]*[*]" 系统函数 (sys 213) 2 2)
    ("[*]/[*]" 系统函数 (sys 214) 2 2)
    ("[*]=[*]" 系统函数 (sys 209) 2 2)
    ("[*]>[*]" 系统函数 (sys 210) 2 2)
    ("[*]<[*]" 系统函数 (sys 211) 2 2)
    ("[*]==[*]" 系统函数 (sys 212) 2 2)
    ("[*]>=[*]" 系统函数 (sys 215) 2 2)
    ("[*]<=[*]" 系统函数 (sys 216) 2 2)
    ("[*]" 系统函数 (sys 217) 1 1)
    ("[*]而且[*]" 系统函数 (sys 224) 2 2)
    ("[*]并且[*]" 系统函数 (sys 225) 2 2)
    ("[*]同时[*]" 系统函数 (sys 226) 2 2)
    ("[*]或者[*]" 系统函数 (sys 223) 2 2)
    ("显示[*][*]" 系统函数 (sys 218) 2 2)
    ("显示[*]" 系统函数 (sys 219) 1 1)
    ("显示新行" 系统无参函数 (sys 220) 0 0)
    ("测试[*]" 系统函数 (sys 221) 1 1)
    ("[*]直到[*]" 系统函数 (sys 222) 2 2)
    ("循环退出[*]" 系统函数 (sys 230) 1 1)
    ("函数返回[*]" 系统函数 (sys 231) 1 1)
    ("[*]是[*]" 系统函数 (sys 232) 2 2)
    ("[*]不是[*]" 系统函数 (sys 233) 2 2)
    ("规格化[*][*]..." 系统函数 (sys 234) 2 inf)
    ("显示[*][*]..." 系统函数 (sys 235) 2 inf)
    ("规格化[*][*]" 系统函数 (sys 236) 2 2)
    ("[*]并且[*]..." 系统函数 (sys 237) 3 inf)
    ("[*]或者[*]..." 系统函数 (sys 238) 3 inf)
    ("[*]而且[*]..." 系统函数 (sys 239) 3 inf)
    ("[*]同时[*]..." 系统函数 (sys 240) 3 inf)
    ("[*]+..." 系统函数 (sys 241) 2 inf)
    ("[*]-..." 系统函数 (sys 242) 2 inf)
    ("[*]*..." 系统函数 (sys 243) 2 inf)
    ("[*]/..." 系统函数 (sys 244) 2 inf)
    ("运行列表参数函数[*][*]、..." 系统函数 (sys 245) 3 inf)
    ("运行列表参数函数[*][*]" 系统函数 (sys 246) 2 2)
    ("[*]、..." 系统函数 (sys 247) 2 inf)
    ;;("[*][*]、..." 系统函数 (sys 248) 3 inf)
    ("[*][*]" 系统函数 (sys 249) 2 2)
    
    ("+" lisp系统函数 (sys 1001) 0 inf +)
    ("-" lisp系统函数 (sys 1002) 0 inf -)
    ("length" lisp系统函数 (sys 1003) 1 1 length)
    ("string-length" lisp系统函数 (sys 1003) 1 1 string-length)
    ("string-ref" lisp系统函数 (sys 1004) 1 1 )
    ("char-to-string" lisp系统函数 (sys 1030) 1 1 string)
    ("substring" lisp系统函数 (sys 1005) 3 3 substring)
    ("string" lisp系统函数 (sys 1006) 1 1 string)
    ("car" lisp系统函数 (sys 1007) 1 1 car)
    ("cdr" lisp系统函数 (sys 1008) 1 1 cdr)
    ("format" lisp系统函数 (sys 1009) 1 inf format)
    ("atom" lisp系统函数 (sys 1010) 1 1 atom?)
    ("listp" lisp系统函数 (sys 1011) 1 1 list?)
    ("numberp" lisp系统函数 (sys 1012) 1 1 number?)
    ("stringp" lisp系统函数 (sys 1013) 1 1 string?)
    ("concat" lisp系统函数 (sys 1014) 0 inf string-append)
    ("or" lisp系统函数 (sys 1015) 0 inf or)
    ("and" lisp系统函数 (sys 1016) 0 inf and)
    ("not" lisp系统函数 (sys 1017) 1 1 not)
    ("list" lisp系统函数 (sys 1020) 0 inf list)
    ("eq" lisp系统函数 (sys 1021) 2 2 eq?)
    ("equal" lisp系统函数 (sys 1022) 2 2 equal?)
    ("set!" lisp系统函数 (sys 1028) 2 2 set!)
    ("setf" lisp系统函数 (sys 1029) 2 2)
    ("y-or-n-p" lisp系统函数 (sys 1030) 1 1 y-or-n)
    (">" lisp系统函数 (sys 1023) 2 2 >)
    ("<" lisp系统函数 (sys 1024) 2 2 <)
    (">=" lisp系统函数 (sys 1025) 2 2 >=)
    ("<=" lisp系统函数 (sys 1026) 2 2 <=)
    ("=" lisp系统函数 (sys 1027) 2 2 *)
    ("/" lisp系统函数 (sys 1019) 1 inf /)
    ("nth" lisp系统函数 (sys 1031) 2 2 list-ref)
    ("nthcdr" lisp系统函数  (sys 1032) 2 2 list-tail)
    ("运行列表参数函数" lisp系统函数 (sys 1033) 2 inf apply)
    ("null?" lisp系统函数 (sys 1034) 1 1 null?)
    ("string-append" lisp系统函数 (sys 1035) 1 inf)
    ("string=?" lisp系统函数 (sys 1036) 2 2)
    ("char=?" lisp系统函数 (sys 1037) 2 2)
    ))
(define cyl-extern-symbol-dict-list '())
(define cyl-local-symbol-dict-list '())
(define cyl-current-symbol-dict-list '())
(define cyl-local-symbol-backup-list '())
(define cyl-parent-symbol-dict-list '())
(define cyl-parent-func-name #f)
(define cyl-parent-func-loc #f)
(define cyl-ancestor-symbol-dict-list '())
(define cyl-parent-symbol-backup-list '())

(define cyl-local-symbol-coding-count '(local 0))

(define (search-dict-member i l)
  (cond
     ((null? l) #f)
     ((null? i) #f)
     ((list? l)
      (cond
       ((and (string? i)(string? (car (car l)))(string=? i (car (car l)))) (car l))
       (else (search-dict-member i (cdr l)))))))
(define (search-dict-member-n i l n)
  (cond
     ((null? l) #f)
     ((null? i) #f)
     ((list? l)
      (cond
       ((and (string? i)(string? (car (car l)))(string=? i (car (car l)))) n)
       (else (search-dict-member-n i (cdr l) (+ n 1)))))))
(define (search-system-dict-member-2 i j l)
   (cond
     ((null? l) #f)
     ((list? l)
      (cond
       ((and (string? i)(string? (car (car l)))(string=? i (car (car l)))
	     (string? j)(string? (nth 5 (car l)))(string=? j (nth 5 (car l))))
	(car l))
       (else (search-system-dict-member-2 i j (cdr l)))))))
(define (search-backup-dict-member s)
 (let ((res #f))
  (tr-list (i e cyl-local-symbol-backup-list 0)
	   (let ((cur-func (nth 0 e))
		 (cur-list (nth 1 e))
		 )
	     (if (string? cur-func)
	     (tr-list (j el cur-list 0)
		      (let ((cur-name (nth 0 el))
			    )
			(if (and (string? cur-name)(string=? s cur-name))
			    (set! res el)))))))
  res))
  
(define (find-system-dict-key-coding-list k)
  (if (null? cyl-current-macro)
      (list #f '() '())
      (let* ((m (car cyl-current-macro))
	     (cur-rec (search-system-dict-member-2 k m cyl-system-symbol-dict-list))
	     )
	(if cur-rec
	    (list (nth 1 cur-rec)(nth 2 cur-rec) cur-rec)
	    (list #f '() '())))))

(define (find-dict-coding-list i dict)
  (let ((type-pos 1)
	(coding-pos 2)
	)
    (cond
     ((eq? dict 'ancestor)
      (let ((cur-rec (search-dict-member i cyl-ancestor-symbol-dict-list)))
	(if cur-rec
	    (list (nth type-pos cur-rec)(nth coding-pos cur-rec) cur-rec)
	    (list #f '() '()))))
     ((eq? dict 'parent)
      (let ((cur-rec (search-dict-member i cyl-parent-symbol-dict-list)))
	(if cur-rec
	    (list (nth type-pos cur-rec)(nth coding-pos cur-rec) cur-rec)
	    (list #f '() '()))))
     ((eq? dict 'system)
      (let ((cur-rec (search-dict-member i cyl-system-symbol-dict-list)))
	(if cur-rec
	    (if (eq? (nth type-pos cur-rec) '系统关键字)
		(if (and (pair? cyl-current-macro) (string? (car cyl-current-macro))(string? (nth 5 cur-rec))(string=? (car cyl-current-macro) (nth 5 cur-rec)))
		    (list '系统关键字 (nth coding-pos cur-rec) cur-rec)
		    (list #f '() '()))
		(list (nth type-pos cur-rec)(nth coding-pos cur-rec) cur-rec))
	    (list #f '() '()))))
     ((eq? dict 'extern)
      (let ((cur-rec (search-dict-member i cyl-extern-symbol-dict-list)))
	(if cur-rec
	    (list (nth type-pos cur-rec)(nth coding-pos cur-rec) cur-rec)
	    (list #f '() '()))))
     ((eq? dict 'local)
      (let ((cur-rec (search-dict-member i cyl-local-symbol-dict-list)))
	(if cur-rec
	    (list (nth type-pos cur-rec)(nth coding-pos cur-rec) cur-rec)
	    (list #f '() '()))))
     ((eq? dict 'current)
      (let ((cur-rec (search-dict-member i cyl-current-symbol-dict-list)))
	(if cur-rec
	    (list (nth type-pos cur-rec)(nth coding-pos cur-rec) cur-rec)
	    (list #f '() '()))))
     (else (list #f '() '())))))
(define (find-local-coding-list s)
  (let* ((res (search-backup-dict-member s)))
    ;;(y-or-n "find-local-coding-list1:res=~a\n" res)
    (if res
	(list (nth 1 res) (nth 2 res) res)
	(let* ((res (find-dict-coding-list s 'local))(cur-st (nth 0 res))(cur-coding (nth 1 res))(cur-rec (nth 2 res)))
	  ;;(y-or-n "find-local-coding-list2:cur-st=~a\n" cur-st)
	  (if cur-st
	      (list cur-st cur-coding cur-rec)
	      (let* ((res (find-dict-coding-list s 'current))(cur-st (nth 0 res))(cur-coding (nth 1 res))(cur-rec (nth 2 res)))
		;;(y-or-n "find-local-coding-list3:cur-st=~a\n" cur-st)
		(if cur-st
		    (list cur-st cur-coding cur-rec)
		    #f)))))))
(define (find-current-coding-list s)
  (let* ((res (find-dict-coding-list s 'local))(cur-st (nth 0 res))(cur-coding (nth 1 res))(cur-rec (nth 2 res)))
    (if cur-st
	(list cur-st cur-coding cur-rec)
	(let* ((res (find-dict-coding-list s 'parent))(cur-st (nth 0 res))(cur-coding (nth 1 res))(cur-rec (nth 2 res)))
	  (if cur-st
	      (cond
	       ((eq? cur-st '参数变量) (list '局部变量 cur-coding (append (list s '局部变量) (list-tail cur-rec 2))))
	       (else (list cur-st cur-coding cur-rec)))
	      (let* ((res (find-dict-coding-list s 'ancestor))(cur-st (nth 0 res))(cur-coding (nth 1 res))(cur-rec (nth 2 res)))
		 (if cur-st
		     (cond
		      ((eq? cur-st '参数变量) (list '局部变量 cur-coding (append (list s '局部变量) (list-tail cur-rec 2))))
		      (else (list cur-st cur-coding cur-rec)))
		     (let* ((res (find-dict-coding-list s 'current))(cur-st (nth 0 res))(cur-coding (nth 1 res))(cur-rec (nth 2 res)))
		       (if cur-st
			   (list cur-st cur-coding cur-rec)
			   (let* ((res (find-dict-coding-list s 'system))(cur-st (nth 0 res))(cur-coding (nth 1 res))(cur-rec (nth 2 res)))
			     (if cur-st
				 (list cur-st cur-coding cur-rec)
				 (let* ((res (find-dict-coding-list s 'extern))(cur-st (nth 0 res))(cur-coding (nth 1 res))(cur-rec (nth 2 res)))
				   (if cur-st
				       (list cur-st cur-coding cur-rec)
				       #f)))))))))))))
(define (get-func-name-define-record s)
  (let ((cur-rec (search-dict-member s cyl-current-symbol-dict-list))
	)
    (if cur-rec
	cur-rec
	(let ((rec (search-backup-dict-member s))
	      )
	  (if rec
	      rec
	      #f)))))
(define (append-load-file s typ)
  (if (and (eq? typ '导入文件)(eq? cyl-define-status 'func-define))
      (let ((cur-item (nth 2 (find-dict-coding-list "@导入局部文件" cyl-local-symbol-dict-list))))
	(if cur-item
	    (begin
	      (set! cyl-local-load-file-list (nth 6 cur-item))
	      (push s cyl-local-load-file-list)
	      (set-car! (list-ref cur-item 6) cyl-local-load-file-list)
	      )
	    (begin
	      (set! cur-item  (list "@导入局部文件" '导入文件 0 0 0 '文件列表 (list s)))
	      (push cur-item cyl-local-symbol-dict-list)
	      (set! cyl-local-load-file-list (nth 6 cur-item))
	      )))
      (let ((cur-item (nth 2 (find-dict-coding-list "@导入全局文件" cyl-current-symbol-dict-list))))
	(if cur-item
	    (begin
	      (set! cyl-load-file-list (nth 6 cur-item))
	      (push s cyl-load-file-list)
	      (set-car! (list-ref cur-item 6) cyl-load-file-list)
	      )
	    (begin
	      (set! cur-item  (list "@导入全局文件" '导入文件 0 0 0 '文件列表 (list s)))
	      (push cur-item cyl-current-symbol-dict-list)
	      (set! cyl-load-file-list (nth 6 cur-item))
	      )))
      ))
	
(define (append-new-coding s typ n)
  (let ((cur-count (+ (cadr cyl-local-symbol-coding-count) 1))(cur-rec '()))
    (cond
     ((or (eq? typ '参数变量)(eq? typ '局部变量)(eq? typ '宏引导变量))
      (set! cur-rec (search-dict-member s cyl-local-symbol-dict-list))
      (if cur-rec
	  (nth 2 cur-rec)
	  (begin
	    (push (list s typ (list 'local cur-count)) cyl-local-symbol-dict-list)
	    (set! cyl-local-symbol-coding-count (list 'local cur-count))
	    cyl-local-symbol-coding-count
	    )
      ))
     ((or (eq? typ '局部函数)(eq? typ '无参局部函数))
      (set! cur-rec (search-dict-member s cyl-local-symbol-dict-list))
      (if cur-rec
	  (nth 2 cur-rec)
	  (begin
	    (push (list s typ (list 'local cur-count) n n) cyl-local-symbol-dict-list)
	    (set! cyl-local-symbol-coding-count (list 'local cur-count))
	    cyl-local-symbol-coding-count
	    )
      ))
     ((eq? typ '全局变量)
      (set! cur-rec (search-dict-member s cyl-current-symbol-dict-list))
      (if cur-rec
	  (nth 2 cur-rec)
	  (begin
	    (push (list s typ (list 'local cur-count)) cyl-current-symbol-dict-list)
	    (set! cyl-local-symbol-coding-count (list 'local cur-count))
	    cyl-local-symbol-coding-count
	    )
      ))
     ((or (eq? typ '函数)(eq? typ 'lisp函数))
      (set! cur-rec (search-dict-member s cyl-current-symbol-dict-list))
      (if cur-rec
	  (nth 2 cur-rec)
	  (begin
	    (push (list s typ (list 'local cur-count) n n) cyl-current-symbol-dict-list)
	    (set! cyl-local-symbol-coding-count (list 'local cur-count))
	    cyl-local-symbol-coding-count
	    )
      ))
     ((eq? typ '无参函数)
      (set! cur-rec (search-dict-member s cyl-current-symbol-dict-list))
      (if cur-rec
	  (nth 2 cur-rec)
	  (begin
	    (push (list s typ (list 'local cur-count) 0 0) cyl-current-symbol-dict-list)
	    (set! cyl-local-symbol-coding-count (list 'local cur-count))
	    cyl-local-symbol-coding-count
	    )
	  ))
     ((eq? typ '无限参数函数)
      (set! cur-rec (search-dict-member s cyl-current-symbol-dict-list))
      (if cur-rec
	  (nth 2 cur-rec)
	  (begin
	    (push (list s '函数 (list 'local cur-count) n 'inf) cyl-current-symbol-dict-list)
	    (set! cyl-local-symbol-coding-count (list 'local cur-count))
	    cyl-local-symbol-coding-count
	    )
      ))
     (else #f))))
(define (cyl-fn-coding-get fn)
  (let ((cur-item (search-dict-member fn cyl-local-symbol-backup-list))
	;;(cur-undef-n (search-dict-member-n fn cyl-undefined-symbol-list 0))
	)
    
    (if cur-item
	(begin
	  (set! cyl-current-define-function-name fn)
	  ;;(set! 编译期正在定义函数名 fn)
	  (set! cyl-local-symbol-dict-list (nth 1 cur-item))
	  ;;(y-or-n "local-list=~a\n" cyl-local-symbol-dict-list)
	  )
	(begin
	  (set! cyl-current-define-function-name fn)
	  ;;(set! 编译期正在定义函数名 fn)
	  (set! cyl-local-symbol-dict-list '())
	  (delete-false-from-undefined-list fn)
	  )
	)
    ))
(define (cyl-fn-parent-coding-get fn i)
  (let ((cur-item (search-dict-member-n fn cyl-local-symbol-backup-list 0))
	(cur-ancestor #f)
	;;(cur-undef-n (search-dict-member-n fn cyl-undefined-symbol-list 0))
	)
    ;;(delete-false-from-undefined-list fn)
    (if (= i 0)
    (if cur-item
	(begin
	  ;;(set! cyl-current-define-function-name fn)
	  ;;(set! 编译期正在定义函数名 fn)
	  (set! cyl-parent-symbol-dict-list (nth 1 (nth cur-item cyl-local-symbol-backup-list)))
	  (set! cyl-parent-func-name fn)
	  (set! cyl-parent-func-loc cur-item)
	  ;;(y-or-n "local-list=~a\n" cyl-local-symbol-dict-list)
	  (set! cur-ancestor (find-dict-coding-list fn 'parent))
	  (if cur-ancestor
	      (begin
		(set! cur-ancestor (nth 1 (nth 0 (nth 6 (nth 2 cur-ancestor)))))
		(if (string? cur-ancestor)
		    (cyl-fn-parent-coding-get cur-ancestor (+ i 1)))
		)))
	(begin
	  ;;(set! cyl-current-define-function-name fn)
	  ;;(set! 编译期正在定义函数名 fn)
	  (set! cyl-parent-func-name fn)
	  (set! cyl-parent-symbol-dict-list '()))
	)
    (if cur-item
	(begin
	  (set! cur-item (search-dict-member fn (nth 1 (nth cur-item cyl-local-symbol-backup-list))))
	  (if (and cur-item (or (eq? (nth 1 cur-item) '局部函数)(eq? (nth 1 cur-item) '无参局部函数)))
	      (begin
		(set! cyl-ancestor-symbol-dict-list (append cyl-ancestor-symbol-dict-list (nth 1 (nth cur-item cyl-local-symbol-backup-list))))
		(set! cur-ancestor (find-dict-coding-list fn 'ancestor))
		(if cur-ancestor
		    (begin
		      (set! cur-ancestor (nth 1 (nth 0 (nth 6 (nth 2 cur-ancestor)))))
		      (if (string? cur-ancestor)
			  (cyl-fn-parent-coding-get cur-ancestor (+ i 1)))
		      )))
	      (set! cyl-ancestor-symbol-dict-list '())))
	(begin
	  (set! cyl-ancestor-symbol-dict-list '())
	  )))
    ))
(define (delete-false-from-undefined-list fn)
  (if (not (null? cyl-undefined-symbol-list))
  (let ((l '()))
    (tr-list (i e cyl-undefined-symbol-list 0)
	     (if (not (string=? (car e) fn))
		 (push e l)
		 (let ((cur-dict  (search-dict-member fn cyl-parent-symbol-backup-list))
		       )
		   (if cur-dict
		       (set! cyl-local-symbol-dict-list (nth 1 cur-dict))))
		       
		  ))
    (set! cyl-undefined-symbol-list (reverse l)))
  )
  )
(define (cyl-fn-coding-push fn)
  (if fn
      (let ((cur-loc (search-dict-member-n fn cyl-local-symbol-backup-list 0))
	    )
	(if (and (string? cyl-parent-func-name)(integer? cyl-parent-func-loc)(not (null? cyl-parent-symbol-dict-list)))
	    (begin
	      (set-car! (list-tail cyl-local-symbol-backup-list cyl-parent-func-loc) (list cyl-parent-func-name cyl-parent-symbol-dict-list))
	      (set! cyl-parent-func-name #f)
	      (set! cyl-parent-func-loc #f)
	      (set! cyl-parent-symbol-dict-list '())
	      (set! cyl-ancestor-symbol-dict-list '())
	      )
	    (if (not (null? cyl-parent-symbol-dict-list))
		(push (list cyl-parent-symbol-func-name cyl-parent-symbol-dict-list) cyl-parent-symbol-dict-list)
		(begin
		  (set! cyl-parent-func-name #f)
		  (set! cyl-parent-func-loc #f)
		  (set! cyl-parent-symbol-dict-list '())
		  (set! cyl-ancestor-symbol-dict-list '())
		  ))
	    )
	(if cur-loc
	    (set-car! (list-tail cyl-local-symbol-backup-list cur-loc) (list fn cyl-local-symbol-dict-list))
	    (push (list fn cyl-local-symbol-dict-list) cyl-local-symbol-backup-list))

	(set! cyl-current-define-function-name #f)
	(set! cyl-current-func-type #f)
	;;(set! 编译期正在定义函数名 #f)
	(set! cyl-local-symbol-dict-list '()))))
(define (cyl-fn-coding-add fn)
  (let ((cur-item (search-dict-member fn cyl-local-symbol-backup-list))
	)
    (if cur-item
	(begin
	  (set! cyl-current-define-function-name fn)
	  ;;(set! 编译期正在定义函数名 fn)
	  (set! cyl-local-symbol-dict-list (append (nth 1 cur-item) cyl-local-symbol-dict-list)))
	(set! cyl-current-define-function-name fn))))
(define (cyl-undefined-func-handle fn)
  (let ((cur-coding #f)
	(n1 (search-dict-member-n fn cyl-undefined-symbol-list 0))
	(n2 (search-dict-member-n fn cyl-current-symbol-dict-list 0))
	)
    (cond
     ((and n1 n2)
      (set! cur-coding (nth 2 (nth n2 cyl-current-symbol-dict-list)))
      (set! cyl-undefined-symbol-list (cyl-delete-from-list n1 cyl-undefined-symbol-list))
      (set! cyl-current-symbol-dict-list (cyl-delete-from-list n2 cyl-current-symbol-dict-list))
      cur-coding
      )
     ((and (not n1) n2)
      (set! cur-coding (nth 2 (nth n2 cyl-current-symbol-dict-list)))
      (set! cyl-current-symbol-dict-list (cyl-delete-from-list n2 cyl-current-symbol-dict-list))
      cur-coding
      )
     ((and (not n2) n1)
      (set! cyl-undefined-symbol-list (cyl-delete-from-list n1 cyl-undefined-symbol-list))
      cur-coding
      )
     ((and (not n1)(not n2))
      cur-coding))
    ))
(define (cyl-delete-from-list n l)
  (let ((res-l '()))
    (if (and (integer? n)(< n (length l)))
	(begin 
	  (tr-list (i e l 0)
		   (if (not (= i n))
		       (push e res-l)))
	  (reverse res-l))
	l)))
(define (get-symbol-special-type-coding s f typ n)      
  (let ((cur-coding #f)
	(cur-typ #f)
	(cur-rec '())
	)
    (let-set! (cur-typ cur-coding cur-rec)(find-current-coding-list s))
    (if cur-typ
	(if (f cur-typ typ)
	    (list cur-coding cur-typ)
	    (list 'err cyl-loc '获取指定类型编码 '非指定类型))
	(cond
	 ((eq? typ '无参函数)
	  (set! cur-coding (append-new-coding s typ 0))
	  (push (list s cur-coding '未定义函数 typ cyl-current-define-function-name) cyl-undefined-symbol-list)
	  (list cur-coding '无参函数))
	 ((eq? typ '隐参变量)
	  (if (eq? cyl-define-status 'func-define)
	      (list (append-new-coding s '局部变量 0) '局部变量)
	      (list (append-new-coding s '全局变量 0) '全局变量))))
	)))

      
      

  
   
   
   
